package com.rd.student.jike.class1.fangzhou.day0731;

import java.util.Random;

public class Test01 {
    public static void main(String[] args) {
        int[] result = new int [20];
        int[] arr = new int[20];
        int num;
        Random rd = new Random();
        int i = 0;
        while(i<20){
            int j = 0;
            boolean f = true;
            num = rd.nextInt(50);
            while(j<i){
                if(num == arr[j]){
                    f = false;
                }
                    j++;
            }
            if(f == true){
                arr[i] = num;
                result[i++] = num;
            }
        }
        for(int k = 0;k< result.length;k++){
            System.out.print(result[k]+" ");
        }
    }
}
